﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="articleTypeList.aspx.cs" Inherits="WebApp.admin.news.articleTypeList" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>文章分类</title>
    <link href="../css/skin.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../js/main.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/jquery.js"></script>
</head>



<body class="body">
    <table class="main" cellpadding="0" cellspacing="0">

        <tr>

            <td class="td_middle_middle">
                <div class="maincontent">
                    <form id="formSearch" action="articleTypeList.aspx">
                        <input id="btnAddType" type="button" class="formButton" value="分类添加" onclick="location.href='articleType.aspx?ot=ad&pid=<%=pid %>';" />
                        <input id="btnParentType" type="button" class="formButton" value="上级分类" onclick="location.href='<%=parentType %>';" />
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <label>
                            查找：</label>
                        <select id="selectType" name="t">
                            <option value="typeName" selected="selected">分类名称</option>
                        </select>
                        <input id="txtKeyWord" type="text" name="kw" value="<%=kw %>" />
                        <input id="btnSearch" type="submit" class="formButton" value="搜  索" />
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <label>
                            每页显示：</label>
                        <select id="selectPageSize" name="ps" onchange="SetPageSize();">
                            <option value="10">10</option>
                            <option value="20" selected="selected">20</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                        <input id="hdPid" type="hidden" value="<%=pid %>" name="pid" />
                    </form>
                    <form id="form1" runat="server">
                        <table cellpadding="0" cellspacing="0">
                            <tr class="tr_title">
                                <td>
                                    <input name="chkall" value="1" type="checkbox" onclick="CheckAll(this,'Item')" title="全选/反选" />
                                </td>
                                <td>
                                    <span onclick="SetOrder('typeName');">分类名称</span></td>
                                <td>
                                    <span onclick="SetOrder('parentId');">上级分类</span></td>
                                <td>
                                    <span onclick="SetOrder('sortOrder');">排序</span></td>
                                <td>
                                    <span onclick="SetOrder('createTime');">日期</span></td>
                                <td>
                                    <span onclick="SetOrder('isShow');">是否显示</span></td>
                                <td>
                                    操作</td>
                            </tr>
                            <asp:Repeater ID="rptArticleType" runat="server" OnItemCommand="rptArticleType_ItemCommand">
                                <ItemTemplate>
                                    <tbody>
                                        <tr>
                                            <td>
                                                <%# GetCheckBox(Eval("typeIdentity"),Eval("id"))%></td>
                                            <td>
                                                <a href="articleTypeList.aspx?pid=<%# Eval("id") %>">
                                                    <%# Eval("typeName")%>
                                                    [<%# this.theArticleType.GetArticleTypeByParentType(Eval("id").ToString()).Rows.Count%>]
                                                </a>
                                            </td>
                                            <td>
                                                <%# Eval("parentId").ToString() == "00000000-0000-0000-0000-000000000000"? "顶级分类" : GetParentType(Eval("parentId"))%>
                                            </td>
                                            <td>
                                                <%# Eval("sortOrder")%>
                                            </td>
                                            <td>
                                                <%# Eval("createTime") %>
                                            </td>
                                            <td>
                                                <%# Convert.ToInt32(Eval("isShow")) == 0 ? "否" : "是"%>
                                            </td>
                                            <td>
                                              <div style="float:left; display:block;" id="divEdit" runat="server">  <a  href="articleType.aspx?ot=ed&id=<%# Eval("id") %>"  title="编辑">[编辑]</a></div>
                                              <div style="float:left; display:block;" id="divDeleted" runat="server">  <a title="删除" href="articleTypeList.aspx?action=del&amp;id=<%# Eval("id") %>" onclick="javascript:return confirm('确定要删除吗?');">[删除]</a></div>
                                        
                                            </td>
                                        </tr>
                                    </tbody>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <tr>
                                        <td colspan="7" style="text-align: center;">
                                            <label id="lblEmpty" style='display: <%# rptArticleType.Items.Count==0?"block":"none"%>;
                                                color: Red;'>
                                                没有找到任何记录</label>
                                        </td>
                                    </tr>
                                </FooterTemplate>
                            </asp:Repeater>
                        </table>
                        <asp:Button ID="btnDelete" runat="server" Text="删除" OnClientClick="return confirm('确定要删除吗？');"
                            OnClick="btnDelete_Click" EnableViewState="false" CssClass="formButton" />
                        <% Response.Write((new Gift.WebApp.PageListNo()).DisplayPage(total, pageSize, pageIndex)); %>
                    </form>
                </div>
            </td>

        </tr>

    </table>
</body>
</html>
